<template>
    <div>
        <el-card class="box-card" shadow="never">
            <div slot="header" class="clearfix">
                <span>短信配置</span>
            </div>
            <el-form ref="form" :model="form" label-width="120px">

                <el-form-item label="服务商">
                    <el-radio-group v-model="form.type">
                        <el-radio default label="aliyun">阿里云</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="短信签名">
                    <el-input v-model="form.sign"></el-input>
                </el-form-item>
                <el-form-item label="短信模板">
                    <el-input v-model="form.template"></el-input>
                </el-form-item>

                <el-form-item label="ACCESS_ID">
                    <el-input v-model="form.access_id"></el-input>
                </el-form-item>
                <el-form-item label="ACCESS_SECRET">
                    <el-input v-model="form.access_secret"></el-input>
                </el-form-item>
            </el-form>
            <el-button type="primary" @click="onSubmit">提交</el-button>
        </el-card>
    </div>
</template>

<script>
export default {
    route: {meta: {title: '短信配置'}},
    data() {
        return {
            form: {}
        }
    },
    async created() {
        this.form = await this.axios.get("admin/sms");
    },
    methods: {
        async onSubmit() {
            await this.axios.put("admin/sms", this.form)
        }
    }
}
</script>

<style scoped>

</style>
